﻿using SMECustomerWebsite.Models.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace SMECustomerWebsite.Models.ViewModels.ReduceRateFee
{
    [Serializable]
    public class Step1ViewModel : IStepViewModel
    {
        [Required]
        public string ReasonReduce{ get; set; }
    }

    [Serializable]
    public class Step2ViewModel : IStepViewModel
    {
        [Required]
        public string RequestReduce { get; set; }
    }

    [Serializable]
    public class Step3ViewModel : IStepViewModel
    {
        [Required]
        public string Baz { get; set; }
    }

    [Serializable]
    public class StepInputReduceRequestViewModel
    {
        public string Cif { get; set; }
        public int CurrentStepIndex { get; set; }
        public IList<IStepViewModel> Steps { get; set; }

        public void Initialize()
        {
            Steps = typeof(IStepViewModel)
                .Assembly
                .GetTypes()
                .Where(t => !t.IsAbstract && typeof(IStepViewModel).IsAssignableFrom(t))
                .Select(t => (IStepViewModel)Activator.CreateInstance(t))
                .ToList();
        }
    }
}